<?php

abstract class Zen_Factory extends Zen_Base
{
    protected $_Zen_Factory = array(
        'adapter' => null,
    );


    final public function __call($method, $params)
    {
        throw $this->_exception('ERR_METHOD_NOT_IMPLEMENTED', array(
            'method' => $method,
            'params' => $params,
        ));
    }


    public function factory()
    {
        // bring in the config and get the adapter class.
        $config = $this->_config;
        $class = $config['adapter'];
        unset($config['adapter']);

        // return the factoried adapter object
        return new $class($config);
    }
}